<template>
  <div id="app">
<Topbar></Topbar>
 <Header></Header>
 <Footer></Footer>
    <router-view/>
    <button @click="fn">点击按钮</button>

  </div>
</template>
<script>
import Topbar from "@/components/Topbar.vue"
import Header from "@/components/Header.vue"
import Footer from "@/components/Footer.vue"
import {JingpinAPI} from "@/request/api"

export default {
 components:{
     Topbar,
  Header,
  Footer,
  },
  methods:{
    async fn() {
      //await 后面可以是一个promise对象
      //await需要在async修饰的函数内使用
         let res = await JingpinAPI();
         console.log("app-res1:",res);
         let res2=await JingpinAPI();
         console.log("app-res2:",res);
    }
  }
}
</script>

<style lang="less">
// #app {
//   font-family: Avenir, Helvetica, Arial, sans-serif;
//   -webkit-font-smoothing: antialiased;
//   -moz-osx-font-smoothing: grayscale;
//   text-align: center;
//   color: #2c3e50;
// }

// nav {
//   padding: 30px;

//   a {
//     font-weight: bold;
//     color: #2c3e50;

//     &.router-link-exact-active {
//       color: #42b983;
//     }
//   }
// }
</style>
